package com.util.dictUtil;

import lombok.Builder;
import lombok.Data;

import java.util.List;

/**
 * @author CHL
 * @ClassName: User
 * @Description: 字典类
 * @date 2022/2/16 16:02
 * @Version 1.0
 */
@Data
@Builder
public class User {

    private Integer id;

    private String sex;


    private String name;

    // refField 表示引用其他字段的值来进行转换逻辑, value 表示去数据库查询的where 条件
    @DictConvert(value = "aaa", refField = "sex")
    private String sexDict;

    @DictConvert(value = "bbb", refField = "name")
    private String nameDict;

    /**
     * 我的儿子
     */
    @DictConvert
    private List<User> mySons;

    /**
     * 媳妇
     */
    @DictConvert
    private User wife;
}

